1. Field of the Invention
The present invention relates to an image processing apparatus, a method of image processing, a computer program, and a storage medium, and for example, to image processing for executing a background color removal process of an image.
2. Description of the Related Art
In general, various image processes for faithfully reproducing a document read by a scanner are executed in a copy process of a digital color copying machine. The color of paper of a document, or the background section, is usually not pure white, but is slightly colored in most cases. Therefore, even the background section is faithfully reproduced using color materials when a copy process is executed, which causes various adverse effects such as wasting of the color materials.
Meanwhile, the following process is known as optimal image processing corresponding to the background color included in a document image. A luminance histogram of an image read by a scanner is first created, and a signal level (hereinafter “background level”) of the background of the document image is detected based on the luminance histogram. A process of removing the background from the image is then executed by subtracting the background level from the image signal.
In general, the background color removal process can be roughly classified into two processes depending on the system configuration including the process.
FIG. 3 illustrates an example of a system configuration of a first background color removal process. In FIG. 3, an image reading unit 101, such as a scanner, reads a document image. A scan image processing unit 301 applies image processing, such as a shading correction process, a filtering process, and an input color correction process not shown, to the document image read by the image reading unit 101. A storage unit 103-31 stores contone image information of one page of document image after the scanner image process. A print image processing unit 302 executes image processing, such as the background color removal process as well as an output color correction process and a halftone process not shown. A storage unit 103-32 stores halftone image information of one page of document image after the print image processing. An image output unit 105, such as a printer, outputs image information stored in a storage area. The contone image information of the read document is temporarily stored in the storage area 103-31, and the background color removal processing unit 303 executes the background color removal process based on the image information of the entire surface of the stored document.
Examples of conventional background color removal processing techniques related to the configuration include Japanese Patent Application Laid-Open Nos. H06-253135 and H08-307722. In Japanese Patent Laid-Open No. H06-253135, a background level is detected from an image read from a document, the read image is stored in a storage unit at the same time, an optimal gamma correction table is created according to the detected background level, and a gamma correction is executed to remove the background of the read image.
In Japanese Patent Application Laid-Open No. H08-307722, a histogram of document is created, the information is used to detect a background level, and the detected background level is used to execute a background color removal process, thereby executing a background color removal process suitable for the document type.
FIG. 4 illustrates an example of a system configuration of a second background color removal process. In FIG. 4, the image reading unit 101 such as a scanner reads a document image. The scan image processing unit 301 applies image processing, such as a shading correction process, a filtering process, and an input color correction process not shown, to the document image read by the image reading unit 101. The print image processing unit 302 executes image processing, such as the background color removal process as well as an output color correction process and a halftone process not shown. A storage unit 103-41 stores halftone image information of one page of document image after the print image processing. The image output unit 105, such as a printer, outputs image information stored in a storage area. The configuration can be realized at lower cost compared to the first system configuration illustrated in FIG. 3 above mentioned because a storage area of one page of contone image is not required. In other words, a storage unit that stores contone image information in the middle of image processing is not included in the configuration of FIG. 4. Therefore, the background process can be sequentially executed while the reading is advanced.
Other examples of the background color removal process include Japanese Patent Application Laid-Open Nos. H06-197216 and 2008-060839. In Japanese Patent Application Laid-Open No. H06-197216, pixels read from a read document are sequentially separated into brightness/color difference information, the white level is changed according to the brightness component, and a threshold is used for the color difference component in an attempt to compress the color value. In this way, the background color is approximated to an achromatic color.
In Japanese Patent Application Laid-Open No. 2008-060839, pixels read from a read document are separated into a brightness component and a color difference component, which of the brightness component and a threshold is greater is determined, and the determined number of pixels is counted to follow up and change the threshold. Which of the color difference component and a threshold is greater is also determined, and the determined number of pixels is counted to follow up and change the threshold.
However, a histogram of document is used for the background color removal methods in Japanese Patent Application Laid-Open Nos. H06-253135 and H08-307722. Therefore, there is a problem that the methods can only be realized on a system configuration that can store contone image information of one page of document as illustrated in FIG. 3. In recent years, the capacity required for the storage device tends to increase with the expansion of the readout resolution of document. In a printer/complex machine field where the competition for cost reduction is intense, the capacity of storage device is one of the large factors that affect the cost, and the use of the present system configuration is an obstacle for realizing the reduced cost.
The brightness component of the foreground color also becomes high in Japanese Patent Application Laid-Open No. H06-197216 unless the background area and the foreground are separated by performing separation into a brightness component and a color difference component by color separation, normalizing the brightness component according to the color of the background area, and compressing the color difference component by a threshold. Therefore, it can be predicted that the image ends up being cloudy as a whole.
In Japanese Patent Application Laid-Open No. 2008-060839, a separation into a brightness component and a color difference component is made by color separation, and the thresholds are followed up and changed for the components. Although the differences between the input values and the thresholds are compared for the brightness component and the color difference component, the brightness of the background area and the foreground affects the threshold estimation in the same way. In other words, the counter variation is not changed according to the difference value in Japanese Patent Application Laid-Open No. 2008-060839. Therefore, the foreground significantly affects the entire document in a read document with less background area and more foreground area, and the density may be removed up to the foreground area of the document. In the use of a copying machine that deals with a variety of types of read documents, it is a problem that the density of the foreground area of document is accidentally removed depending on the type of read document.